/*
 * CorbaSender.h
 *
 *  Created on: Mar 31, 2011
 *      Author: alban
 */

#ifndef CORBASENDER_H_
#define CORBASENDER_H_

// CORBA Stub
#include "KiBeam.hh"

// OpenNI lib
#include <XnCppWrapper.h>

/**
 * This class enables the communication with CORBA ORB.
 * It offers a hight level programming for IDL interface.
 */
class CorbaSender {
public:
  /**
   * Open a CORBA exchange stream
   * @param argc argc from main function
   * @param argv argv from main function
   */
  CorbaSender(int argc, char ** argv);

  /**
   * Sends data of each node to CORBA ORB
   * @param g_UserGenerator the data contained by OpenNI struct
   */
  void send(xn::UserGenerator g_UserGenerator);

  /**
   * Sends an event when a new user comes
   * @param user_id the id of comming user
   */
  void newUserEvent(unsigned long user_id);

  /**
   * Sends an event when a user leaves
   * @param user_id the id of leaving user
   */
  void lostUserEvent(unsigned long user_id);

  virtual ~CorbaSender();

private:

  KiBeam::Data_var _dataref;

};

#endif /* CORBASENDER_H_ */
